package com.byit.Test.yield;

/**
 * @ClassName YieldExample
 * @Description 屈服的意思,Thread 的方法,使同等优先级,
 * 或更高优先级的线程加入竞争线程空间,其本身也会竞争线程空间,如果有等待的线程,线程级别低,不能竞争线程空间
 * @Author lxp
 * @Date 2018/10/9 0009
 **/
public class YieldExample {
    public static void main(String[] args)
    {
        Thread producer = new Producer();
        Thread consumer = new Consumer();

        producer.setPriority(Thread.MIN_PRIORITY); //Min Priority
        consumer.setPriority(Thread.MAX_PRIORITY); //Max Priority
        consumer.start();
        producer.start();

    }
}
